{extend name="base" /}
{block name="main"}
<div class="tpl-content-wrapper">
    <div class="tpl-content-page-title">
        用户列表
    </div>
    <ol class="am-breadcrumb">
        <li><a href="#" class="am-icon-home">首页</a></li>
        <li><a href="#">用户管理</a></li>
        <li class="am-active">实名审核</li>
    </ol>
    <div class="tpl-portlet-components">
        <div class="portlet-title">
            <div class="caption font-green bold">
                <span class="am-icon-code"></span> 列表
            </div>



        </div>
        <div class="tpl-block">
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">




                        </div>
                    </div>
                </div>


            </div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main am-table-centered">
                            <thead>
                            <tr>
                                <th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>
                                <th class="table-id">ID</th>
                                <th class="table-title">电话</th>
                                <th class="table-type">姓名</th>
                                <th class="table-date">身份证号</th>
                                <th class="table-date">实名状态</th>
                                <th class="table-date">余额</th>
                                <th class="table-date am-hide-sm-only">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if empty($data)} <td colspan="8">无信息</td>
                            {else}
                            {volist name='data' id='user'}
                            <tr>
                                <td><input type="checkbox"></td>
                                <td>{$user.id}</td>
                                <td>{$user.tel}</td>
                                <td>{$user.name}</td>
                                <td>{$user.idcard}</td>
                                <td class="am-hide-sm-only" id="status-{$user.id}">认证中</td>
                                <td>{$user.money}</td>
                                <td>
                                    <div class="">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <button type="button" class="am-btn am-btn-default am-btn-xs fff u-status" u-status="3" u-uid="{$user.id}"><span class="am-icon-pencil-square-o"></span> 通过</button>
                                            <button type="button" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only btn-del u-status" u-status="1" u-uid="{$user.id}"><span class="am-icon-trash-o"></span> 不通过</button>
                                        </div>
                                    </div>
                                </td>

                            </tr>
                            {/volist}
                            {/if}
                            </tbody>
                        </table>
                        <div class="am-cf">

                            <div class="am-fr">
                                    {$page}
                            </div>
                        </div>
                        <hr>

                    </form>
                </div>

            </div>
        </div>
        <div class="tpl-alert"></div>
    </div>


</div>

<script>
    $(function(){
       var $ustu = $('.u-status');
       $ustu.click(function(){
           var uid = $(this).attr('u-uid');
           var stu = $(this).attr('u-status');
           var obj = $(this);
           $.ajax({
               type:'post',
               url:'/admin/User/changeshiming',
               data:{'id':uid,'status':stu},
               success:function(data){
                   if(data.status == 3){
                       alert(data.msg);
                       obj.parents('tr').remove();
                   }else if(data.status == 1){
                       alert(data.msg);
                       obj.parents('tr').remove();
                   }else{
                       alert(data.msg);
                   }
               },
               error:function(data){
                   alert(data.msg);
               }
           })
       })



    });



</script>


{/block}